package com.itheima.marking_system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.itheima.marking_system.mapper.TeacherMapper;
import com.itheima.marking_system.pojo.entity.TeacherEntity;
import com.itheima.marking_system.service.TeacherService;
import org.springframework.stereotype.Service;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Service
public class TeacherServiceImpl extends ServiceImpl <TeacherMapper, TeacherEntity> implements TeacherService {

    public boolean checkPhone(String mobileNumber) {
        String regex = "^1[3456789]\\d{9}$";
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(mobileNumber);
        return matcher.matches();
    }

}
